package com.tianquan.Transactional;/**
 * @author starsea
 * @date 2024-10-03 下午9:19
 */

import org.springframework.aop.framework.ProxyFactory;

/**
 *@BelongsProject: uploaddemo
 *@BelongsPackage: com.tianquan.redis
 *@Author: tianquan
 *@CreateTime: 2024-10-03  21:19
 *@Description: 代理工具
 *@Version: 1.0
 */
public final class ProxyUtils {

    private ProxyUtils(){}

    public static Object getProxy(Object target, org.aopalliance.intercept.MethodInterceptor methodInterceptor){
        ProxyFactory proxyFactory = new ProxyFactory();
        proxyFactory.setTarget(target);
        proxyFactory.addAdvice(methodInterceptor);
        return proxyFactory.getProxy();
    }
}

